<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String IP = request.getRemoteAddr();
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>奖金、罚款处理页面</title>
<style>
</style>
</head>
<body>
<div>
	<form action="wages/fine.action" method="post" id="form">
	<table border="1">
		<tr>
			<th>工号</th><th>姓名</th>
		</tr>
		<c:forEach items="${managerList }" var="item">
			<tr>
				<td><input type="checkbox" name="iUserId" class="iUserId" value="${item.iUserId }" />${item.iUserId }</td>
				<td>${item.sName }</td>
			</tr>
		</c:forEach>
		<tr>
			<td>奖金<input type="number" id="sBonus" name="sBonus" title="请输入金额" /></td>
			<td>补助<input type="number" id="sSubsidy" name="sSubsidy" title="请输入金额" /></td>
			<td>罚款<input type="number" id="sFine" name="sFine" title="请输入金额" /></td>
		</tr>
		<tr>
			<td colspan="3"><input type="button" value="确认提交" onclick="bonus()"/></td>
		</tr>
	</table>
	</form>
</div>
</body>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
	function bonus(){
		if(0 == $(".iUserId:checked").length){
			alert("请选择要修改的项");
			return false;
		}else if(1 != $(".iUserId:checked").length){
			alert("只能选择一项进行修改");
			return false;
		}
		if("" == $("#sBonus").val()){
			$("#sBonus").val(0);
		}else if(isNaN(parseFloat($("#sBonus").val()))){
			alert("请输入指定类型");
			return false;
		}else{
			$("#sBonus").val(parseFloat($("#sBonus").val()));
		}
		if("" == $("#sSubsidy").val()){
			$("#sSubsidy").val(0);
		}else if(isNaN(parseFloat($("#sSubsidy").val()))){
			alert("请输入指定类型");
			return false;
		}else{
			$("#sSubsidy").val(parseFloat($("#sSubsidy").val()));
		}
		if("" == $("#sFine").val()){
			$("#sFine").val(0);
		}else if(isNaN(parseFloat($("#sFine").val()))){
			alert("请输入指定类型");
			return false;
		}else{
			$("#sFine").val(parseFloat($("#sFine").val()));
		}
		document.getElementById("form").submit();
	}
</script>
</html>